<?php

/*
  Action	$5

  +1$
  If you have 3 cards or less in your hand +4 cards, otherwise +3 cards

 */

class GunShop extends Card implements iAction, iKingdom, iAddiction {

    public function __construct() {
        parent::__construct("Gun Shop", 5);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }
    
     public function getDescription() {
        return array(
            "+1$",
            "If you have 3 cards or less in your hand +4 cards, otherwise +3 cards");
    }

    public function play(Game $game, $isRealCard) {
        
        $game->addMoney(new Price(1));
        $playHandSize = $game->getPlayHandSize();
        if ($playHandSize <= 3) {
            $drawed_cards = $game->drawCards(4);
        } else {
            $drawed_cards = $game->drawCards(3);
        }

        ScreenDisplay::addScreenMessage($game, true, "get +1$ and draw " . nicePrint($drawed_cards), "gets +1$ and draws " . sizeof($drawed_cards) . " cards");
		$game->cardActionFinished();
        return true;
    }

}

?>